package donot996.icu.tieba.controller;

import donot996.icu.tieba.domain.User;
import donot996.icu.tieba.response.JsonResult;
import donot996.icu.tieba.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserController {
    @Autowired
    IUserService userService;

    @GetMapping("/info")
    public JsonResult<User> userInfo(Long id){
        User byId = userService.getById(id);
        return JsonResult.success(byId);
    };

    @PostMapping("/info")
    public JsonResult<User> userInfo2(Long id){
        User byId = userService.getById(id);
        return JsonResult.success(byId);
    };

}
